Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hapi/boom

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/boom

HTTP-friendly error objects

  • 8.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1M
decreased by-24.76%
Maintainers
1
Weekly downloads
 
Created

What is @hapi/boom?

The @hapi/boom npm package is a utility for returning HTTP-friendly error objects. It provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object, which includes the following properties: statusCode, error, message, and a constructor that can be used to create a new error.

What are @hapi/boom's main functionalities?

Creating HTTP error objects

This feature allows you to create error objects that are appropriate for HTTP responses. For example, you can create a 404 error when a resource is not found.

{"statusCode": 404, "error": "Not Found", "message": "Cannot find the specified resource"}

Decorating error objects

This feature allows you to add additional information to the error object, such as validation details or other context-specific data.

{"statusCode": 400, "error": "Bad Request", "message": "Invalid request payload input", "data": { "details": [ {"message": "'value' is not allowed"} ] }}

Custom error messages

This feature allows you to specify a custom message for the error object, which can be more descriptive and helpful for debugging.

{"statusCode": 400, "error": "Bad Request", "message": "Custom error message"}

Other packages similar to @hapi/boom

Keywords

FAQs

Package last updated on 28 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc